package controllers.job;

import play.Play;
import play.jobs.Every;
import play.jobs.Job;
import play.jobs.On;
import play.vfs.VirtualFile;
import utils.process.CommandExecutor;

import java.io.IOException;

/**
 * Created by FireFire on 7/10 0010.
 * 每天执行一次，拉取代码，
 */
@On("0 0 1 1/1 * ? ")
public class UpdateVersion extends Job {
    @Override
    public void doJob() throws Exception {
        CommandExecutor executor = CommandExecutor.createCommandExecutor();
        String msg = executor.invoke("git","pull");
        String msg2 = executor.invoke("play","restart");
        System.out.println(msg);
        System.out.println(msg2);
    }
}
